﻿using System;
using System.Collections.Generic;

namespace ShortestPaths
{
    public class DijkstraAllPairsSP
    {
        private DijkstraSP[] all;

        public DijkstraAllPairsSP(EdgeWeightedDigraph G)
        {
            all = new DijkstraSP[G.V()];
            for (int v = 0; v < G.V(); v++)
            {
                all[v] = new DijkstraSP(G,v);
            }
        }

        public IEnumerable<DirectedEdge> Path(int s, int t)
        {
            return all[s].Path(t);
        }

        public double Dist(int s, int t)
        {
            return all[s].Dist(t);
        }
    }
}
